SCRIPT_PATH = debug.getinfo(1).source:sub(debug.getinfo(1).source:find(".*\\")):sub(2)
dofile(SCRIPT_PATH .. "Common/AllClass.lua")

function OnTick()
    if not lastUsed or os.clock() - lastUsed > 0.25 then
        for i = 1, heroManager.iCount, 1 do
            local target = heroManager:getHero(i)
            if target and target.visible and target.valid and not target.dead then
                if target.team == player.team then
                    if player:CanUseSpell(_E) == READY and player:GetDistance(target) < 575 and target.health ~= target.maxHealth and not TargetHaveBuff({"SummonerTeleport","Recall","RecallImproved"}) then CastSpell(_E) end
                elseif target.team == TEAM_ENEMY then
                    local d = player:GetDistance(target)
                    if player:CanUseSpell(_Q) == READY and d > 0 and d < 310 then CastSpell(_Q) end
                end
            end
        end
    end
end

function OnLoad()
    if player.charName ~= "Alistar" then
        OnTick = function() end
    end
end
